<template>
  <div class="todo-item">
    <input type="checkbox" class="toggle" v-model="chuanzhi">
    <label>{{val1}}</label>
    <button class="destroy" @click="deletePerson(wei)">X</button>
  </div>
</template>

<script>
export default {
  props: {
    chuanzhi: {
      type: Boolean,
      required: true
    },
    val1: {
      type: String,
      required: true
    },
    wei: {
      type: Number,
      required: true
    }
  },
  methods: {
    deletePerson () {
      this.$emit('childByValue', this.wei)
    }
  }
}
</script>
